/**
 * Created by duocai on 2017/7/2.
 */
// 异步请求demo
$(document).ready(function(){
    $("#addToCart").click(function(){
        $.get("./buy?artwork="+$("#artworkID").val(), function (data, status) {
            if (data.toString() === "1"){
                alert("Add to your cart successfully.")
            }
			else {
				window.location.href = "./loginPage.jsp";
			}
        })
    });
});